<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p>这是第二页</p>
    <a href="./4_网页的前进后退3.html">下一页</a><br>
    <br>
    <button class="btn1">后退</button>
    <button class="btn2">前进</button>
    <script>
        document.querySelector(".btn1").onclick = function () {
            history.go(-1);
        }
        document.querySelector(".btn2").onclick = function () {
            history.go(1);
        }
    </script>
</body>

</html>